<?php
defined('_JEXEC') or die;

$pck=intval($this->data->package);
$id=$this->data->id;
$db=JFactory::getDBO();
//all about options
$opts=$this->data->information['options'];
if($opts){
	$opts=explode(",", $opts);
	$db->setQuery("SELECT id, title, text, parent FROM #__questions_core WHERE catid=15");
	$options=$db->loadObjectList();
	foreach($options as $item)
		if(($tmp=array_search($item->id-28, $opts)))
			$opts[$tmp]=$item;
}
//all about payment
$db->setQuery("SELECT * FROM #__user_payment WHERE id_user=$id");
$payment=$db->loadObject();
//prices
$params=JComponentHelper::getParams('com_questions');
$packcost=array($params->get("price1"), $params->get("price2"), $params->get("price3"), $params->get("price4"));
$packtxt=array("Pakke 1", "Pakke 2", "Pakke 3", "Fitness Pakke");
$fee=$params->get("memberfee");
?>
<div class="wrapper">
	<div class="content clearfix" id="price-page">
		<div class="">
			<div class="col-box">
				<h1 class="c292929">Pakkevalg</h1>
				<div class="box-temp clearfix">
					<div id="b-1">
					</div>
					<div id="b-2-" class="relative">
						<p class="p-title" style="position: static;margin:0"><?php echo $packtxt[$pck-1]?></p>
					</div>
				</div>
				<table id="m-table2">
					<tbody>
<?php
	//package information
	$packid=array(10, 11, 12, 16);
	$db->setQuery("SELECT id, title, text, parent, published
	FROM #__questions_core
	WHERE catid=".$packid[$pck-1]);
	$prop = $db->loadObjectList();
	$i=0;

	foreach($prop as $item){
		echo '<tr',$i ? ' class="even"' : '','>
				<td class="t-col-1-">
					<p>',$item->title,'</p>
				</td>
				<td class="t-col-2">
				',$item->published ? '<img src="templates/fitplan/img/imgCheck-1.png" alt="">' : '','
				</td>
			</tr>';
	}
	?>
					<tr class="none">
						<td class="t-col-1- none"></td>
					</tr>

				</tbody></table>
			</div>
			<div class="col-box">
				<h1 class="c292929">Vælg tilkøb (valgfrit)</h1>
				<div class="clr"></div>
				<table id="m-table3">
					<tbody>
<?php
	foreach($opts as $item):
?>
					<tr>
						<td class="t-col-5-1">
							<p><a href="#" title=""><img src="templates/fitplan/img/imgInfo.png" alt=""></a><?php echo $item->title?></p>
						</td>
					</tr>
<?php endforeach;?>
				</tbody></table>
			</div>

		</div>

		<div class="clear"></div>
	</div>
</div>